﻿using System;
using System.Web;
using System.Windows.Forms;

namespace test
{
    public partial class Form2 : Form
    {
        public Form2()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            string d = this.richTextBox1.Text;
            //d = HttpUtility.UrlEncode(d, System.Text.Encoding.GetEncoding("GB2312"));
            d = HttpUtility.UrlEncode(d, System.Text.Encoding.UTF8);
            this.richTextBox2.Text = d;
        }

        private void button2_Click(object sender, EventArgs e)
        {
            string d = this.richTextBox1.Text;
            //d = HttpUtility.UrlDecode(d, System.Text.Encoding.GetEncoding("GB2312"));
            d = HttpUtility.UrlDecode(d, System.Text.Encoding.UTF8);
            this.richTextBox2.Text = d;
        }
    }
}